classdef Individual < handle
    %UNTITLED Summary of this class goes here
    %   Detailed explanation goes here
    
    properties
        objective_value
        total_cost
        connections
        shortest_paths
        stops_handle
        objective_counter
        spojnosc_in_engilsh
        b = 10;
        stala = 10;
    end
    
    methods
        
        function obj = Individual()

        end
        
        function [he,hv,ht] = disp_connections(ind)
           % gplot( ind.connections , ind.stops.positions )
           [he,hv,ht] = wgPlot((ind.connections .*ind.stops_handle.distances) + diag(ind.stops_handle.wages),ind.stops_handle.positions,true);
        end
        
        function o = compute_objective(ind)
            [o,sp] = ind.objective_counter.compute(ind);
            
%             mask = mask_generator( ind.connections );
%             graph_distances = ind.stops.distances + mask;
%             ind.shortest_paths = FastFloyd(graph_distances);
%             b=1; %TODO: refactor
%             ind.total_cost = cost( ind.stops.costs, ind.connections );
%             o = objective(ind.shortest_paths, ind.stops.wages, b*ind.total_cost );
            ind.objective_value = o;
            ind.spojnosc_in_engilsh = sp;
        end
        

        % maybe TODO: sort overload
%         function [obj,idx]=sort(obj,varargin)
%             [~,idx]=sort([obj.objective_value],varargin{:}); 
%             obj=obj(idx);
%         end
               
    end
    

    
end

